import nyNetwork from "@/api/nyBaseNetwork";

class DZModelVideo {

    /**
     * 视频ID
     */
    id = '';

    /**
     * 公司权限ID
     */
    company = '';

    /**
     * 视频类型
     */
    typeName = '';

    /**
     * 类型id
     */
    typeId = '';

    /**
     * 是否发布
     */
    publish = '0';

    /**
     * 排序
     */
    sort = 0;

    /**
     * 置顶
     */
    top = 0;

    set arr_company(data) {
        this.company = data.join(",");
    }

    get arr_company() {
        return this.company.nyIsEmpty() ? [] : this.company.split(",");
    }

    /**
     * 列表封面ID
     */
    cover = "";

    /**
     * 列表封面路径
     */
    coverUrl = "";

    /**
     * 视频标题
     */
    title = "";

    /**
     * 视频描述
     */
    desc = "";

    /**
     * 视频文件ID
     */
    video = "";

    /**
     * 视频文件路径
     */
    videoUrl = "";

    /**
     * 观看人数
     */
    lookNum = 0;

    /**
     * 创建时间
     */
    time = "";

    prase(data) {
        this.id = data.iId ?? '';
        this.cover = data.iCoverId ?? '';
        if (data.iCoverId) {
            this.coverUrl = nyNetwork.image(data.iCoverId);
        }
        this.title = data.sTitle ?? '';
        this.desc = data.sDesc ?? '';
        this.video = data.iVideoId ?? '';
        if (data.iVideoId) {
            this.videoUrl = nyNetwork.video(data.iVideoId);
        }
        this.lookNum = data.iLookNum ?? 0;
        this.time = data.createTime ?? '';
        this.company = data.sCompanyIds ?? '';
        this.typeId = data.iTypeId ?? '';
        this.publish = ''+data.iPublish ?? '';
        this.sort = data.iSort ?? 0;
        this.top = data.iTop ?? 0;
    }



}
export default DZModelVideo;